package com.amado.easyui2.service.impl;

import java.util.List;

import com.amado.easyui2.dao.CoachCarDao;
import com.amado.easyui2.dao.impl.CoachCarDaoImpl;
import com.amado.easyui2.domain.CoachCarEntity;
import com.amado.easyui2.domain.User;
import com.amado.easyui2.service.CoachService;
import com.amado.easyui2.vo.Page;

public class CoachServiceImpl implements CoachService {
	private CoachCarDao coachDao = new CoachCarDaoImpl();

	@Override
	public void add(CoachCarEntity lcn) {
		// TODO Auto-generated method stub
		coachDao.add(lcn);
	}

	@Override
	public List<CoachCarEntity> list() {
		// TODO Auto-generated method stub
		return coachDao.listAll();
	}

//	@Override
//	public void delete(Long id) {
//		// TODO Auto-generated method stub
//		coachDao.delete(id);
//	}

	@Override
	public void update(CoachCarEntity lcn) {
		// TODO Auto-generated method stub
		coachDao.update(lcn);
	}

	@Override
	public List<CoachCarEntity> list(String tm, String lcn) {
		// TODO Auto-generated method stub
		return coachDao.listAll(tm, lcn);
	}

	@Override
	public List<CoachCarEntity> getCoach(CoachCarEntity lcn) {
		// TODO Auto-generated method stub
		return coachDao.login(lcn);
	}

	@Override
	public Page<CoachCarEntity> listAll(String tm, String lcn, Page page) {
		int total = coachDao.listAllCount(tm, lcn);
		Page<CoachCarEntity> newPage  = new Page<>();
		newPage.setTotal(total);
		newPage.setRows(coachDao.listAll(tm, lcn,page));
		return newPage;
	}

	@Override
	public void delete(List<Long> id) {
		coachDao.delete(id);
		
	}

}
